﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Calculate_Price
{
    public  class cl_0423_Bag : cl_0423_Shop
    {
        private ArrayList list = new ArrayList();

        public cl_0423_Bag(string dz)
        {
            if (dz == "红色小袋子")
            {
                Console.WriteLine("装进红色小袋子");
            }
            else
            {
                if (dz=="白色小袋子")
                    Console.WriteLine("装进白色小袋子");
                else if(dz=="大袋子")
                    Console.WriteLine("装进大袋子");
                else if(dz=="中袋子")
                    Console.WriteLine("装进中袋子");
            }
           
        }

        public void add(cl_0423_Shop sp)
        {
            list.Add(sp);
        }
        public override double GetPrice()
        {
            double temp= 0;
            for (int i = 0; i < list.Count; i++)
            {
                temp+=((cl_0423_Shop)list[i]).GetPrice();
            }
            return temp;
        }
        

        
        
       
    }
}